	$(document).ready(function() {
				//加载默认菜单
				if(sessionStorage['rules']){
					var rules=JSON.parse(sessionStorage['rules']);
					var parentmenu=new Array();
					//添加一级菜单
					for (var i = 0; i < rules.length; i++) {
						if(rules[i].pid==0) {
							parentmenu.push(rules[i]);
						}
					}
					//添加一级菜单的子菜单
					for (var i = 0; i < rules.length; i++) {
						if(rules[i].pid!=0) {
							for (var j = 0; j < parentmenu.length; j++) {
								if(rules[i].pid==parentmenu[j].id){
									if (!parentmenu[j]["child"]) {
										parentmenu[j]["child"]=new Array();
									}
									parentmenu[j]["child"].push(rules[i]);
								}
							}
						} 
					}
				//加载dommenu
				var ul=$('.sidebar-menu');
				for (var i = 0; i < parentmenu.length; i++) {
					var $li=$("<li></li>");
					$li.addClass("treeview");
					$li.append("<a href='/"+parentmenu[i].name+"'><i class='fa fa-dashboard'></i><span>"+parentmenu[i].title+"</span><span class='pull-right-container'><i class='fa fa-angle-left pull-right'></i></span></a>")
				    ul.append($li);
				    if(parentmenu[i].child.length>0){
				    	var $lichild=$("<ul></ul>");
				    	$lichild.addClass("treeview-menu");
				    	$lichild.css("display","none");
				    	$li.append($lichild);
				    }
				    for (var k = 0; k < parentmenu[i].child.length; k++) {
				    	var $childli=$("<li></li>");
					    $childli.append("<a href=/"+parentmenu[i].child[k].name+"><i class='fa fa-circle-o'></i>"+parentmenu[i].child[k].title+"</a>")
					    $lichild.append($childli);
				    }
				}
				}else{
					location.href="/";
				}
	})